<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRefundLogTable extends Migration
{
    public function up()
    {
    	//退款日志
        Schema::create('refund_log', function (Blueprint $table) {
	        $table->increments( 'id' );
	        $table->unsignedInteger( 'user_id' )->comment( '用户ID' );
	        $table->string( 'out_trade_no', 23 )->comment( '订单号' );
	        $table->string( 'trade_no', 64 )->comment( '第三方交易号' );
	        $table->string( 'buyer_id', 64 )->comment( '第三方用户ID' );
	        $table->unsignedTinyInteger( 'type' )->comment( '退款类型 支付宝:1 微信:2' );
	        $table->unsignedDecimal( 'total_amount', 10, 2 )->comment( '退款金额' );
	        $table->timestamp( 'refund_time' )->comment( '退款时间' );
	        $table->timestamps();
        });
    }
    public function down()
    {
	    Schema::dropIfExists( 'refund_log' );
    }
}
